<fieldset>
    <legend>{:lang('条件搜索')}</legend>
    <form class="layui-form layui-form-pane form-search" action="{:sysuri()}" onsubmit="return false" method="get" autocomplete="off">

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">飞手昵称</label>
            <label class="layui-input-inline">
                <input name="nickname" value="{$get.nickname|default=''}" placeholder="请输入飞手昵称" class="layui-input">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">飞手姓名</label>
            <label class="layui-input-inline">
                <input name="realname" value="{$get.realname|default=''}" placeholder="请输入飞手姓名" class="layui-input">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">审核状态</label>
            <div class="layui-input-inline">
                <select class="layui-select" name="gov_review_status">
                    <option value=''>-- 全部 --</option>
                    {foreach ['0'=>'待审核', '1'=>'已通过', '-1'=>'未通过'] as $k=>$v}
                    {if isset($get.status) and $get.status eq $k.""}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/if}{/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">创建时间</label>
            <label class="layui-input-inline">
                <input data-date-range name="create_at" value="{$get.create_at|default=''}" placeholder="请选择创建时间" class="layui-input">
            </label>
        </div>

        <div class="layui-form-item layui-inline">
            <button type="submit" class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> {:lang('搜 索')}</button>
            <button type="button" data-form-export="{:url('index')}?type={$type|default=''}" class="layui-btn layui-btn-primary">
                <i class="layui-icon layui-icon-export"></i> {:lang('导 出')}
            </button>
        </div>
    </form>
</fieldset>

<script>
    require(['excel'], function (excel) {
        excel.bind(function (data) {
            // 设置表格内容
            data.forEach(function (item, index) {
                let status_text = item.status === 0 ? '待审核' : item.status === 1 ? '已通过' : item.status === -1 ? '已通过' : '未知';
                data[index] = [item.id, item.pilot.realname, item.realname, item.bank_name, item.branch_nane, item.card_no, item.money, status_text, item.create_at];
            });
            // 设置表头内容
            data.unshift(['ID', '提现用户姓名', '持卡人姓名', '银行名称', '支行名称', '银行卡号', '提现金额', '审核状态', '创建时间']);
            // 应用表格样式
            return this.withStyle(data, {A: 100});
        }, '飞手提现申请列表' + layui.util.toDateString(Date.now(), '_yyyyMMdd_HHmmss'));
    });
</script>
